﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.TeamFoundation.Build.Client;
using UCL.Powersource;

namespace UCL.Powersource.TFS
{

    public interface IRemoteBuilderQueueItem
    {
        ITfsTeamProjectConfiguration Project { get; }
        ITimeFrame TimeFrame { get; }
        IBuildDetail BuildDetail { get; }
        QueuedItemStatus Status { get; }
        IRemoteBuilderQueue Owner { get; }
        Exception BuildException { get; }
        Boolean HasTerminatedNormally { get; }
        //event EventHandler<QueuedItemChangedEventArgs> Changed;
        event EventHandler Completed;
    }





    public interface IRemoteBuilderQueue : UCL.Powersource.IInitiliazedLifeCycle, INotifyPropertyChangedEx
    {
        IRemoteBuilderQueueItem GetBuild(ITfsTeamProjectConfiguration project, ITimeFrame timeFrame, bool forceRecalculate);
        IRemoteBuilderQueueItem GetBuildAsync(ITfsTeamProjectConfiguration project, ITimeFrame timeFrame, bool forceRecalculate, System.Action OnCompletedCallback);
        event EventHandler<RemoteBuilderQueueEventArgs> RemoteBuilderQueueUpdated;
        void TerminateCurrentBuild();
        void TerminateAllBuilds();

        bool IsCalculating { get; }
        string CurrentAction { get; }
        int WaitingBuildsCount { get; }
        int FinishedBuildsCount { get; }
    }
}
